<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="my" uri="/mytags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>过程管理</title>
 
 
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/asserts/bootstrap-3.3.7-dist/css/bootstrap.min.css"/>
	
	<!-- js插件 -->
		<script src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
		<script src="${pageContext.request.contextPath}/asserts/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
        <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/asserts/bootstrapValidate/css/bootstrapValidator.min.css"/>
 	   <script src="${pageContext.request.contextPath}/asserts/bootstrapValidate/js/bootstrapValidator.min.js"></script>
	
	 		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/asserts/datetimepicker/css/bootstrap-datetimepicker.css"/>
	 	   <script src="${pageContext.request.contextPath}/asserts/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
	<script src="${pageContext.request.contextPath}/asserts/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
</head>
<body>
	<!-- 内容展示区 -->
	<div>
		<!-- 导航 -->
		<ol class="breadcrumb">
			<li><i class="fa fa-comment"></i> 文件图片归档统计</li>
		</ol>
		<!-- 	内容面板 -->
		<div class="panel panel-default">
		 
			<!-- 控制按钮  end-->
			<div class="panel-body">
				<form action="${pageContext.request.contextPath}/datatotal/listprocess"
					method="post" class="form-horizontal">
  					<div class="form-group">
								      		<label class="control-label col-md-2">学年(开始时间)：</label>
										<div class="col-md-3" >
											  <input type="text" name="beginDate"  id="beginDate" value="<fmt:formatDate value="${dataTotal.beginDate}" pattern="yyyy-MM-dd" />" data-date-format="yyyy-MM-dd"
         				    			  class="form-control input-inline form_time" placeholder="请选择开始时间"  readonly="readonly">
 
											 
										</div>
										<label class="control-label col-md-2">学年(结束时间)：</label>
										<div class="col-md-3" id="endDate">
											  <input type="text" name="endDate" id="endDate" value="<fmt:formatDate value="${dataTotal.endDate}" pattern="yyyy-MM-dd" />" data-date-format="yyyy-MM-dd"
          						     class="form-control input-inline form_time" placeholder="请选择结束时间" readonly="readonly">
 
										</div>
						 </div>

					<div class="form-group">
						<label class="control-label col-md-2">乡镇：</label>
						<div class="col-md-3">
							<select id="zid" name="zid" class="form-control"
								onchange="changeZhen(this)">
								<option value="">请选择</option>
							</select>
						</div>
						<label class="control-label col-md-2">所在学校：</label>
						<div class="col-md-3">
							<select id="schoolname" name="schoolname" class="form-control">
								<option value="">请选择</option>
							</select>
						</div>
						<div class="col-md-2">
							<button class="btn btn-success">查询</button>
						</div>
					</div></div>

				</form>

				<table   class="table table-bordered table-striped table-condensed table-hover">
					<tr>
						<th width="5px">标题</th>
						<th width="5%">基本情况图片</th>
						<th width="9%">承诺书</th>
						<th width="9%">领导小组文件</th>
						<th width="9%">评审小组文件</th>
						<th width="9%">会议记录</th>
						<th width="9%">签领表</th>
						<th width="9%">银行流水</th>
						<th width="9%">所属学校</th>
						<th width="9%">状态</th>
						<th width="9%">归档时间</th>
					</tr>
					<!-- 数据绑定 -->
					<c:forEach items="${pageInfo.list}" var="pro">
						<tr>
							<td width="50px" height="50px">${pro.title}</td>
							<td> 
							<img
							src="../../img/${pro.basicfile}" style="height: 100px; width: 100px;"
							onmouseover="this.style.cursor='pointer';this.style.cursor='hand'"
							onmouseout="this.style.cursor='default'"
							onclick="showimage('../../img/${pro.basicfile}')" data-toggle="modal"
							data-target="#ShowImage_Form" />
							</td>
							<td> 
							<img
							src="../../img/${pro.promisefile}" style="height: 100px; width: 100px;"
							onmouseover="this.style.cursor='pointer';this.style.cursor='hand'"
							onmouseout="this.style.cursor='default'"
							onclick="showimage('../../img/${pro.promisefile}')" data-toggle="modal"
							data-target="#ShowImage_Form" />
							</td>
							<td> 
							<img
							src="../../img/${pro.leaderfile}" style="height: 100px; width: 100px;"
							onmouseover="this.style.cursor='pointer';this.style.cursor='hand'"
							onmouseout="this.style.cursor='default'"
							onclick="showimage('../../img/${pro.leaderfile}')" data-toggle="modal"
							data-target="#ShowImage_Form" />
							</td>
							<td> 
							<img
							src="../../img/${pro.assessfile}" style="height: 100px; width: 100px;"
							onmouseover="this.style.cursor='pointer';this.style.cursor='hand'"
							onmouseout="this.style.cursor='default'"
							onclick="showimage('../../img/${pro.assessfile}')" data-toggle="modal"
							data-target="#ShowImage_Form" />
							</td>
							<td> 
							<img
							src="../../img/${pro.meetingfile}" style="height: 100px; width: 100px;"
							onmouseover="this.style.cursor='pointer';this.style.cursor='hand'"
							onmouseout="this.style.cursor='default'"
							onclick="showimage('../../img/${pro.meetingfile}')" data-toggle="modal"
							data-target="#ShowImage_Form" />
							</td>
							<td>
							<img
							src="../../img/${pro.signaturefile}" style="height: 100px; width: 100px;"
							onmouseover="this.style.cursor='pointer';this.style.cursor='hand'"
							onmouseout="this.style.cursor='default'"
							onclick="showimage('../../img/${pro.signaturefile}')" data-toggle="modal"
							data-target="#ShowImage_Form" />
							</td>
							<td> 
							<img
							src="../../img/${pro.bankfile}" style="height: 100px; width: 100px;"
							onmouseover="this.style.cursor='pointer';this.style.cursor='hand'"
							onmouseout="this.style.cursor='default'"
							onclick="showimage('../../img/${pro.bankfile}')" data-toggle="modal"
							data-target="#ShowImage_Form" />
							</td>
							<td>${pro.schoolname}</td>
							<td><c:if test="${pro.status==1}">初稿</c:if> <c:if
									test="${pro.status==2}">镇级别审核中</c:if> <c:if
									test="${pro.status==3}">县级别审核中</c:if> <c:if
									test="${pro.status==4}">归档</c:if></td>
							<td><fmt:formatDate type="both" dateStyle="medium"
									timeStyle="medium" value="${pro.finishdate}" /></td>
							 
						</tr>
					</c:forEach>

					<!-- 	数据绑定 end -->
				</table>
				<!-- 	分页 -->
				<my:page prePage="${pageInfo.prePage}"
					nextPage="${pageInfo.nextPage}"
					url="${pageContext.request.contextPath}/datatotal/listprocess?n=1"
					totalPage="${pageInfo.pages}" currentPage="${pageInfo.pageNum}" />
			</div>
		</div>
		<!-- 内容面板 end -->
	</div>
  	<div id="ShowImage_Form" class="modal fade">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal">
				<span>&times;</span>
			</button>
		</div>
		<div class="modal-body">
			<div id="img_show"></div>
		</div>
	</div>
</body>
</html>
<script>
$(function () {
	 
    //页面加载时，查询所有的 县
     $.ajax({
			url : 'getAllZhen',
			type : "get",
			dataType : "json",
			success : function(data) {
				 
				$("#zid option:gt(0)").remove();
				for(var i=0;i<data.length;i++){
					var opt = "<option value='"+data[i].id+"'>"+data[i].name+"</optoin>";
					$("#zid").append(opt);
				}
			},
			error : function(xhr) {
				alert(xhr);
			}
		});

		$('.form_time').datetimepicker({
		 format: 'yyyy-mm-dd',
		 language:"zh-CN",
		 minView: "month",
		 autoclose: true,//选中自动关闭
		 todayBtn: true, //显示今日按钮
		 clearBtn : true,
		 pickerPosition: "bottom-left"
		/*  locale: moment.locale('zh-cn') */
		});
		     
     



}); 
function changeZhen(obj){
	 //ajax  查询 公安县 下所有的镇 
	if(obj.value!=''){
		  $.ajax({
				url : '../ztree/getBaseInfo?pid='+obj.value,
				type : "get",
				dataType : "json",
				success : function(data) {
					if(data!=null){
						$("#schoolname option:gt(0)").remove();
						for(var i=0;i<data.length;i++){
							var opt = "<option value='"+data[i].name+"'>"+data[i].name+"</optoin>";
							$("#schoolname").append(opt);
						}
					}
				},
				error : function(xhr) {
					//alert(xhr.status);
				}
			});
	}	
}
	 
	 function showimage(source) {
			$("#ShowImage_Form")
					.find("#img_show")
					.html(
							"<center><img src='"+source+"' class='img-responsive img-rounded' /></center>");
			// $("#ShowImage_Form").modal(); 
		}
	 
	 
</script>